﻿using SIS.Infrastructures.Dependencies;
using System.Collections.Generic;

namespace SIS.Services.Common
{
    public interface IBaseServices<T> :IService where T : class, new()
    {
        /// <summary>
        /// 通用添加
        /// </summary>
        /// <param name="entity">要添加的实体对象</param>
        /// <returns>返回最新的ID</returns>
        int Insert(T entity);
        /// <summary>
        /// 通用删除
        /// </summary>
        /// <param name="entity">要删除的对象</param>
        /// <returns>返回受影响行数</returns>
        int Delete(T entity);
        /// <summary>
        /// 通用更新
        /// </summary>
        /// <param name="entity">要更新的对象</param>
        /// <returns>返回受影响行数</returns>
        int Update(T entity);
        /// <summary>
        /// 返回通用获取单表数据
        /// </summary>
        /// <returns>返回指定对象集合</returns>
        IList<T> GetAll();
    }
}
